# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Simon Sapin <simon dot sapin at exyr dot org>
# Contributor: Kyle Keen <keenerd@gmail.com>

pkgname=python-ldap3
pkgver=2.9.1
pkgrel=4
pkgdesc="A strictly RFC 4510 conforming LDAP V3 pure Python client library"
url="https://github.com/cannatag/ldap3"
license=('LGPL')
arch=('any')
depends=('python-pyasn1')
makedepends=('python-setuptools')
checkdepends=('python-nose')
source=("$pkgname-$pkgver.tar.gz::https://github.com/cannatag/ldap3/archive/v$pkgver.tar.gz")
sha512sums=('bf07ebca9a53a8c225bc3106d3bd45eb26557c6e5a3d6d45a7f8c149d938ad43825eed0d406a57b93e2e675ed7aa262828f022ab82eb683f0e3029e3ad823106')

build() {
  cd "$srcdir"/ldap3-$pkgver
  python setup.py build
}

check() {
  cd "$srcdir"/ldap3-$pkgver
  nosetests3 -s test || echo "Tests require a running LDAP server"
}

package() {
  cd ldap3-$pkgver
  python setup.py install --root="$pkgdir" --optimize=1
}
